package com.rain.cy.business.handler;

import com.rain.cy.business.handler.base.BaseProcessHandler;
import com.rain.cy.business.handler.base.ProcessHandler;
import com.rain.cy.business.model.dto.UserProcessDataDTO;
import com.rain.cy.business.model.json.BaseProcessDataJson;
import com.rain.cy.business.model.json.ProcessThreeOfDataJson;
import com.rain.cy.business.model.json.ProcessTwoOfDataJson;
import com.rain.cy.business.service.UserProcessStatusService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yu_chen
 * @since 2021/10/10 17:41
 */
@Component
public class ProcessThreeHandler extends BaseProcessHandler {

    @Autowired
    private UserProcessStatusService userProcessStatusService;

    @Override
    public BaseProcessDataJson initProcessDataJson() {
        ProcessThreeOfDataJson dataJson=new ProcessThreeOfDataJson();
        dataJson.setTreatmentMode("");
        dataJson.setChemotherapyRegimen("");
        return dataJson;
    }

    @Override
    public void handler(UserProcessDataDTO userProcessDataDTO) {
        Integer userId = userProcessDataDTO.getUserId();
        ProcessThreeOfDataJson processDataJson = (ProcessThreeOfDataJson) userProcessDataDTO.getBaseProcessDataJson();
        if (processDataJson==null){
            return;
        }
        userProcessStatusService.updateUserProcessStatus(userId,"3001","3002","3003","40");
    }

}
